# Maintainer: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
pkgname=py3-kikit
pkgver=1.2.0
pkgrel=1
pkgdesc="Python library and CLI tool to automate several tasks in KiCAD"
url="https://github.com/yaqwsx/KiKit"
# riscv64: py3-shapely
# aarch64, armv7, armhf, mips64: py3-solidpython
# s390x: kicad
arch="noarch !riscv64 !aarch64 !armv7 !armhf !s390x"
license="MIT"
depends="
	kicad
	py3-click
	py3-commentjson
	py3-markdown2
	py3-pcbnewtransition
	py3-pybars3
	py3-shapely
	py3-solidpython
	python3
	"
makedepends="
	py3-gpep517
	py3-python-versioneer
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/yaqwsx/KiKit/archive/v$pkgver.tar.gz

	0000-kicad-v7.patch
	"
builddir="$srcdir/KiKit-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	cd test/units
	../../.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
695ac7c60e6974df8173a328cad4c5b297f06ae572807cb92ae0bdb93ff59e4f26770c6ee09778709a2b6ffd0f6a0a932fdc5876931e4f5011b8125ca6f629c5  py3-kikit-1.2.0.tar.gz
1ccd934d7f981fbf665336888eb70bc9a11f8133e5fef610fcb48d64290b940e571a9cd9a46a2b4dd7b5d2e0a220d831f4551c2a697bcc941b26485fb945de71  0000-kicad-v7.patch
"
